package com.xhtt.modules.task.model.alltask;

import com.xhtt.common.utils.DateUtils;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
public class ExcelTaskAllModel {
    private String plan;//大的任务分类 ship pot service oper
    private String planTypeName;
    private Integer status;
    private String statusName;
    private Integer percent;
    private String percentName;

    private String planTaskName;

    private String team_user;


    private String task_percent;

    private LocalDateTime planStartDate;
    private String planStartDateName;

    public String getPlan() {
        if ("ship".equals(plan)) {
            return "装卸船任务";
        } else if ("pot".equals(plan)) {
            return "倒罐任务";
        } else if ("service".equals(plan)) {
            return "维修任务";
        } else if ("oper".equals(plan)) {
            return "操作任务";
        } else
            return this.plan;
    }

    public String getStatusName() {
        if (null == this.status) {
            return "";
        }
        if (this.status.intValue() == 0 || this.status.intValue() == 1) {
            return "已登记";
        } else if (this.status.intValue() == 2 || this.status.intValue() == 3) {
            return "计划员已安排";
        } else if (this.status.intValue() == 4) {
            return "任务已分配";
        } else if (this.status.intValue() >= 9) {
            return "已结束";
        } else {
            return "";
        }
    }

    public String getPercentName() {
        return this.percent + "%";
    }

    public String getPlanStartDateName() {
        if(null!=this.planStartDate)
        {
            return this.planStartDate.format(DateUtils.dtfm);
        }
        return "";
    }
}
